<!DOCTYPE html>
<html>
<head>
<title>用户注册-民网积分管理系统</title>
<link href="__PUBLIC__/Intesys/AdminX/css/style.css" rel="stylesheet">
<link href="__PUBLIC__/Intesys/AdminX/css/style-responsive.css" rel="stylesheet">
</head>
<body class="login-body">
<style>
	.iconic-input>i{z-index:3;border-radius: 4px;margin: 0;height: 39px;width: 39px;background: #f5f5f5;padding: 13px;}
	.iconic-input>.form-control{font-size:14px; padding-left:50px !important;}
	.input-group input{ margin-bottom:0 !important}
	.input-group-addon{ color:#999; min-width:39px;}
</style>
<form action="{:U('dosignin')}" name="dologin" onSubmit="return formsubmit();" method="post" id="verifyform" class="checkoutform form-signin  section_main">
	
    
    <div class="form-signin-heading text-center">
        <h1 class="sign-title">用户注册</h1>
        <img src="__PUBLIC__/Intesys/AdminX/images/login_logo.png" alt="网站LOGO"/>
    </div>
    <div class="login-wrap">
    	<div class="form-group">
        	<div class="input-group">
                <span class="input-group-addon"><i class="fa icon-mobile"></i></span>
                <input type="text" datatype="*" id="form-tel" nullmsg="手机号码不能为空" errormsg="不支持特殊字符" class="form-control" placeholder="请输入手机号码" name="tel">
            </div>
        </div>
    	<div class="form-group">
        	<div class="input-group">
                <span class="input-group-addon"><i class="fa icon-lock"></i></span>
                <input type="password" datatype="*6-18"  class="form-control" placeholder="输入密码" name="password">
            </div>
        </div>
    	<div class="form-group">
        	<div class="input-group">
                <span class="input-group-addon"><i class="fa icon-lock"></i></span>
                <input name="confirm_password" type="password" recheck="password" datatype="*6-18" class="form-control" placeholder="确认密码">
            </div>
        </div> 
    	
        <div class="row">
        	<div class="col-xs-7">
                <input type="text" datatype="*" nullmsg="验证码不能为空" errormsg="验证码不能为空" class="form-control" style="margin-bottom:0px;" placeholder="请输入验证码" name="vali">
            </div>
            <div class="col-xs-5">
            	<button class="btn btn-default btn-block js-getmobile" id="sendsms" style="height:39px;" type="button">获取验证码</button>
            </div>
        </div>
        <label class="checkbox">
            <input datatype="*"  nullmsg="必须同意协议才能使用" errormsg="请同意协议" name="read" type="checkbox">我已阅读并同意<a href="javascript:void(0)">《积分管理系统用户注册协议》</a>
        </label>
        
        <input type="hidden" name="code" value="{$Think.get.code}">
        <input type="hidden" name="gid" value="{$Think.get.gid}">
        <input type="hidden" name="pid" value="{$Think.get.pid}">
        
        <button type="button" onClick="return formsubmit();" class="btn btn-login btn-block">注 册</button>
        <div class="registration">
        	已经注册？立即
            <a href="{:U('login', array('code' => $_GET['code'], 'gid' => $_GET['gid'], 'pid' => $_GET['pid'], 'type' => 1))}" class="">登录</a>
        </div>
    </div>
</form>
<!-- End Login Screen --> 
<script src="__PUBLIC__/Intesys/AdminX/js/jquery-1.10.2.min.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/modernizr.min.js"></script>
<script src="__PUBLIC__/Js/validform/Validform.js"></script>
<script>

var countdown = 1*60; 
function settime(val) {
if (countdown == 0) {
val.removeAttribute("disabled");    
val.innerHTML="免费获取验证码"; 
countdown = 1*60;
return false;
} else { 
val.setAttribute("disabled", true); 
val.innerHTML="重新发送(" + countdown + ")"; 
countdown--;

} 
setTimeout(function() { 
settime(val) 
},1000) 
} 
function formsubmit(){
	$.ajax({
		url : $('#verifyform').attr('action'),
		data:$('#verifyform').serialize(),
		dataType:"json",
		type:'POST',
		success: function(data){
			if(data.status == 1){
				alert('注册成功');
				window.location.href = data.url;
			}else{
				alert(data.info);
			}
		}
	});
	return false;
}
	$(document).ready(function(e) {
		//注册表单的验证
		/*$(".section_main").Validform({
			tiptype:function(msg,o,cssctl){
				if(!o.obj.is("form")){
					var objtip=o.obj.siblings(".Validform_checktip");
					cssctl(objtip,o.type);
					objtip.text(msg);
				}else{
					var objtip=o.obj.find("#msgdemo");
					cssctl(objtip,o.type);
					objtip.text(msg);
				}
			}
		});*/
		
		//获取验证码
		$(".js-getmobile").click(function(e) {
            $.post('{:U('VerifyPhoneSend')}', {tel:$('#form-tel').val()}, function(d){
				alert(d.info);
				if(d.status == 1){
					settime(document.getElementById('sendsms'));
				}
				
			},'json');
        });
	});
</script>
</body>
</html>